/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function saveMessage(){
    var textMessage = $('#messageText').val();
    var pseudoMessage = $('#pseudoText').val();
    
    $.ajax({
      type: "POST",
      url: "http://127.0.0.1/Rilke/ZoneInteractive/dataManagement.php",
      data: "message=" + textMessage + "&pseudo=" + pseudoMessage + "&reload=false",
      success: function( msg ) {
        alert( msg )}
    });
    
    $('#messageText').val('');
    $('#pseudoText').val('');
    updateViewer();
}

function updateViewer(){  
      $.ajax({
      type: "POST",
      url: "http://127.0.0.1/Rilke/ZoneInteractive/dataManagement.php",
      data: "message=none&pseudo=none&reload=true",
      success: function( msg ) {
       $('#messageList').html(msg)
        }
    });
}